/*    */ package tools.packet;
/*    */ 
/*    */ import constants.ServerConstants;
/*    */ import handling.opcode.SendPacketOpcode;
/*    */ import java.util.List;
/*    */ import org.apache.logging.log4j.LogManager;
/*    */ import org.apache.logging.log4j.Logger;
/*    */ import server.reward.StarReward;
/*    */ import tools.data.output.MaplePacketLittleEndianWriter;
/*    */ 
/*    */ public class RewardPacket
/*    */ {
/* 13 */   private static final Logger log = LogManager.getLogger(RewardPacket.class);
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   public static byte[] StarRewardInfo(List<StarReward> rewardList) {
/* 22 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 23 */     mplew.writeShort(SendPacketOpcode.REWARD_GIFT.getValue());
/* 24 */     mplew.write(ServerConstants.MapleStatusInfo.星星奖励.getType());
/* 25 */     mplew.writeInt(rewardList.size());
/* 26 */     for (StarReward object : rewardList) {
/* 27 */       mplew.writeInt(object.getId());
/* 28 */       mplew.writeLong(PacketHelper.getTime(object.getStartTime().getTime()));
/* 29 */       mplew.writeLong(PacketHelper.getTime(object.getEndTime().getTime()));
/*    */       
/* 31 */       mplew.writeInt(1);
/* 32 */       mplew.writeInt(object.getItemid());
/* 33 */       mplew.writeInt(object.getQuantity());
/* 34 */       mplew.writeInt(object.getUnk());
/*    */       
/* 36 */       mplew.writeLong((object.getPeriod() == -2) ? PacketHelper.getTime(object.getPeriod()) : PacketHelper.getTime(System.currentTimeMillis() + (object.getPeriod() * 1000)));
/* 37 */       mplew.writeInt(0);
/* 38 */       mplew.writeInt(0);
/* 39 */       mplew.writeInt(0);
/* 40 */       mplew.writeInt(0);
/* 41 */       mplew.writeInt(0);
/* 42 */       mplew.writeInt(-99);
/* 43 */       mplew.writeInt(-99);
/*    */       
/* 45 */       mplew.writeMapleAsciiString("");
/* 46 */       mplew.writeMapleAsciiString("");
/* 47 */       mplew.writeMapleAsciiString("");
/* 48 */       mplew.writeMapleAsciiString(object.getMsg());
/*    */     } 
/*    */     
/* 51 */     return mplew.getPacket();
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   public static byte[] StarRewardOp(int id) {
/* 60 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 61 */     mplew.writeShort(SendPacketOpcode.REWARD_GIFT.getValue());
/* 62 */     mplew.write(ServerConstants.MapleStatusInfo.星星奖励_领取.getType());
/*    */     
/* 64 */     mplew.writeInt(id);
/*    */     
/* 66 */     return mplew.getPacket();
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\tools\packet\RewardPacket.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */